package router

import (
	"github.com/gin-gonic/gin"
	"mock-exam2/handler"
	"net/http"
)

func Init() *gin.Engine {
	r := gin.Default()
	r.GET("/", func(c *gin.Context) {
		c.String(http.StatusOK, "hello World!")
	})
	r.POST("/login", handler.Login)
	r.POST("/roleAddNode", handler.RoleAddNode)
	r.GET("/userDetail", handler.UserDetail)
	r.GET("/roleDetail", handler.RoleDetail)
	r.POST("/goodAdd", handler.GoodAdd)
	r.POST("/orderAdd", handler.OrderAdd)
	r.GET("/orderList", handler.OrderList)
	r.POST("/employeeAdd", handler.EmployAdd)
	r.POST("/workAdd", handler.WorkAdd)
	r.GET("/workList", handler.WorkList)
	return r
}
